//----------------------------------------------------------
// Copyright (C) 2008 XDev Software, LLC. All rights reserved.
// You may modify this code and needed and you can use this code
// at your own risk. XDev Software is not responsible for any 
// damages that may occur from this code.
//----------------------------------------------------------
// filmstrip.js
function moveFilmStripDown(sender, args)
{
    var objCan = sender.findName("filmImgCan");   
    var objCanHeight = objCan.Height;   
    var objCanTop = objCan["Canvas.Top"];
    
    var itemCnt = objCan.children.count;
    //each image is 100 x 100 and the strip holds about 3.25 images
    var maxScroll = (itemCnt * -110) + 325;
    
    if(objCanTop < maxScroll)
    {
        //alert(objCanTop);  
    }
    else
    {
        sender.findName("animationDown").begin();
        objCan["Canvas.Top"] -= 50;
    }
}

function moveFilmStripUp(sender, args)
{   
    var objCan = sender.findName("filmImgCan");    
    var objCanHeight = objCan.Height;   
    var objCanTop = objCan["Canvas.Top"];

    if(objCanTop > -30)
    {
        //alert(objCanTop);  
    }
    else
    {
        sender.findName("animationUp").begin();
        //objCan["Canvas.Top"] += 50;
    } 
}

function stopFilmStripDown(sender, args)
{
    sender.findName("animationDown").stop();
}

function stopFilmStripUp(sender, args)
{
    sender.findName("animationUp").stop();
}

function getMovie(sender, args)
{
    var objSender = sender;
    var movieName = sender["Tag"];   
    var strMovie = sender["Name"];
    
    getMovieDetail(movieName); //this function is located on hightlight.aspx
            
    var player = new StartPlayer_0("divPlayer_0", strMovie);
}

//this is called from higlights.aspx.cs
function showClipDetail(message, context)
{
    var objText = document.getElementById('clipDetails');
    objText.innerHTML = message;
}

//this also goes and gets the details of the film
function doGlowClip(sender, args)
{
    sender["Opacity"] = 1.0;    
    var movID = sender["Tag"];   
    getMovieDetail(movID);
}

//remove the glow and details of the clip
function undoGlowClip(sender, args)
{
    sender["Opacity"] = .5;
}

function showThumbDetail(message, context)
{
    alert(message);
}

function doHighlightTriaUp(sender, args)
{
    var triaUp = sender.findName("btnTriangleUp");
    
    triaUp["Fill"] = "Yellow";
    triaUp["Stroke"] = "Black";
}
function undoHighlightTriaUp(sender, args)
{
    var triaUp = sender.findName("btnTriangleUp");
    
    triaUp["Fill"] = "#66666666";
    triaUp["Stroke"] = "Silver";
}
function doHighlightTriaDown(sender, args)
{
    var triaUp = sender.findName("btnTriangleDown");
    
    triaUp["Fill"] = "Yellow";
    triaUp["Stroke"] = "Black";
}
function undoHighlightTriaDown(sender, args)
{
    var triaUp = sender.findName("btnTriangleDown");
    
    triaUp["Fill"] = "#66666666";
    triaUp["Stroke"] = "Silver";
}